﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewData["Title"] = "一起牛-优秀编程博客栖息地_更多关于软件开发疑难问题解决方案的提供者";
    ViewData["keywords"] = "网站建设,小程序开发,App开发,网站模板,PPT模板,一起牛";
    ViewData["Description"] = "一起牛坚持以优质IT资源信息为理念,努力通过图文并茂形式分享网站建设,小程序开发,App开发,网站模板等有价值、有生产力的信息。";
}
@using ShenNius.Blog.ViewModels
@model IndexVM

<div class="lbox">
    <div class="clearblank"></div>
    <!--特别推荐-->
    <div class="zhuanti whitebg">
        <h2 class="htitle">
            <span class="hnav">
                <a href="@{@domainConfig.CurrentValue.Host}/site-templet/">网站模板</a> &nbsp;
                <a href="@{@domainConfig.CurrentValue.Host}/ppt/">PPT模板</a>&nbsp;
                <a href="@{@domainConfig.CurrentValue.Host}/source/" target="_blank">资源分享</a> &nbsp;
                <a href="@{@domainConfig.CurrentValue.Host}/blog/" target="_blank">技术博文</a>
            </span>特别推荐
        </h2>
        <ul>
            @foreach (var item in Model.RecArticleList)
            {
                string detailUrl = domainConfig.CurrentValue.Host;
                @if (string.IsNullOrEmpty(item.ParentColumnUrl))
                {
                    detailUrl += $"/{item.EnTitle}/{item.Id}.html";
                }
                else
                {
                    detailUrl += $"/{item.ParentColumnUrl}/{item.EnTitle}/{item.Id}.html";
                }
                string imgSrc = WebHelper.GetContentFirstImg(item.Content);
                <li>
                    <i class="ztpic">
                        <a href="@detailUrl" target="_blank" title="@item.Title">
                            @if (!string.IsNullOrEmpty(imgSrc))
                            {
                                @if (imgSrc.Contains(domainConfig.CurrentValue.ImgHost))
                                {
                                    <img src="@imgSrc" alt="@item.Title" />
                                }
                                else
                                {
                                    <img src="@domainConfig.CurrentValue.ImgHost@imgSrc" alt="@item.Title" />
                                }
                            }
                            else
                            {
                                <img src="/image/banner_1.jpg" alt="@item.Title" />

                            }
                        </a>
                    </i> <b>@item.Title</b>
                    <span>
                        @Html.Raw(item.Summary)
                    </span>
                    <a href="@detailUrl" target="_blank" title="@item.Title" class="readmore">阅读原文</a>
                </li>
            }
        </ul>
    </div>
    @*<div class="ad whitebg"><a href="http://www.yangqq.com/download/div/917.html" target="_blank"><img src="../image/longad.jpg"></a></div>*@

    <div class="whitebg bloglist">
        <h2 class="htitle">最新文章</h2>
        <ul>
            @foreach (var item in Model.CategoryArticleList)
            {
                string imgSrc = WebHelper.GetContentFirstImg(item.Content);
                string detailUrl = domainConfig.CurrentValue.Host;
                @if (string.IsNullOrEmpty(item.ParentColumnUrl))
                {
                    detailUrl += $"/{item.EnTitle}/{item.Id}.html";
                }
                else
                {
                    detailUrl += $"/{item.ParentColumnUrl}/{item.EnTitle}/{item.Id}.html";
                }
                <li>
                    <h3 class="blogtitle"><b>【@item.Hits】</b><a href="@detailUrl" target="_blank" title="@item.Title">@item.Title</a></h3>

                    @if (!string.IsNullOrEmpty(imgSrc))
                    {
                        <span class="blogpic imgscale">

                            <a href="@detailUrl" title="@item.Title" class="echo">
                                @if (imgSrc.Contains(domainConfig.CurrentValue.ImgHost))
                                {
                                    <img src="@imgSrc" alt="@item.Title" />
                                }
                                else
                                {
                                    <img src="@domainConfig.CurrentValue.ImgHost@imgSrc" alt="@item.Title" />
                                }
                            </a>
                        </span>
                    }
                    <p class="blogtext">@Html.Raw(item.Summary)</p>
                    <p class="bloginfo">
                        <i class="avatar">
                        <a href="@detailUrl" target="_blank" title="@item.Title">
                            <img src="/image/avatar.jpg" border="0" width="30" height="30" alt="@item.Title">
                        </a>
                    </i>
                        <span></span><span>@item.CreateTime</span><span>【<a href="@domainConfig.CurrentValue.Host@Url.Action("Search","home",new { keyword=item.Tag})/" target="_blank">@item.Tag</a>】</span>
                    </p>
                    <a href="@domainConfig.CurrentValue.Host@Url.Action("newslist","home",new { parentColumnUrl=item.ParentColumnUrl,childColumnUrl=item.EnTitle})/" class="viewmore">阅读更多</a>
                </li>
            }
        </ul>
    </div>
</div>

@await Component.InvokeAsync("Right", new { isIndex = true })
<div class="links whitebg box ">
    <div class="news-title">
        <h2>友情链接</h2>
    </div>
    <ul>
        @foreach (var item in Model?.FriendlyLinkList)
        {
            <li><a href="@item.LinkUrl" target="@item.Target">@item.Title</a></li>
        }       
    </ul>
</div>
